def business_attribute_test_1():
  """Predifined configuration:
  Tenant CfgTenantAuto
  Business Attributes CfgBAMediaType and CfgBAReasonCode
  
  action: create new BA value
  """
  
  CfgAttributeValueBAMediaType = CfgAttributeValue()
  CfgAttributeValueBAMediaType.SetAttributes({"name":           "AttributeValueMediaType_new", 
                                              "enumeratorDBID": CfgBAMediaType.DBID,
                                              "tenantDBID":     CfgTenantAuto.DBID,
                                              "displayName":    "AttributeValueMediaType_new"})
                                      
  CfgAttributeValueBAMediaType.Add()  
  raw_input("New value for Media Type added. Check. Press Enter.")
  CfgAttributeValueBAReasonCode = CfgAttributeValue()
  CfgAttributeValueBAReasonCode.SetAttributes({"name":           "AttributeValueReasonCode_new", 
                                               "enumeratorDBID": CfgBAReasonCode.DBID,
                                               "tenantDBID":     CfgTenantAuto.DBID,
                                               "displayName":    "AttributeValueReasonCode_new"})
                                      
  CfgAttributeValueBAReasonCode.Add()  
  raw_input("New value for Reason Code added. Check. Press Enter.")
  
  raw_input("Added values will be deleted. Press Enter.")
  CfgAttributeValueBAMediaType.Delete()
  CfgAttributeValueBAReasonCode.Delete()
  
def capacity_rule_test_1():
  """Predifined configuration:
  Tenant CfgTenantAuto
  CfgScriptCapRuleA_M
  CfgScriptCapRuleA1_M
  CfgScriptCapRuleA2_M
  CfgScriptCapRuleB_M
  
  Agent CfgPersonAgent1
  #AgentGroup CfgAgentGroup1 
  Place CfgPlace1
  #PlaceGroup CfgPlaceGroup1 """
  
  #---------add new capacity rule---------------
  
  
  CfgScriptCapRuleA = CfgScript()
  CfgScriptCapRuleA.SetAttributes({"name":           "CapacityRule_A",
                                   "tenantDBID":     CfgTenantAuto.DBID,
                                   "type":           CfgScriptType.CFGCapacityRule.val,
                                   "userProperties": CfgScriptCapRuleA_M.userProperties                      
                                   })
  CfgScriptCapRuleA.Add()  
  raw_input("Capacity rule added. Name = %s, tenant = %s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleA.name, CfgTenantAuto.name))

  #---------edit capacity rule---------------
  CfgScriptCapRuleA.BeginChange()
  CfgScriptCapRuleA.name = "CapacityRule_A1"
  CfgScriptCapRuleA.userProperties = CfgScriptCapRuleA1_M.userProperties
  CfgScriptCapRuleA.EndChange()
  raw_input("Capacity rule changed. Name = %s, tenant = %s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleA.name, CfgTenantAuto.name))

  #---------assign cap rule A to agent, place, place group, agent group, tenant---------------
  CfgPersonAgent1.BeginChange()
  CfgPersonAgent1.agentInfo.capacityRuleDBID = CfgScriptCapRuleA.DBID
  CfgPersonAgent1.EndChange()
  raw_input("Capacity rule %s assigned to agent %s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleA.name, CfgPersonAgent1.userName))

  CfgPlace1.BeginChange()
  CfgPlace1.capacityRuleDBID = CfgScriptCapRuleA.DBID
  CfgPlace1.EndChange()
  raw_input("Capacity rule %s assigned to place %s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleA.name, CfgPlace1.name))


  #CfgPlaceGroup1.BeginChange()
  #CfgPlaceGroup1.groupInfo.capacityRuleDBID = CfgScriptCapRuleA.DBID
  #CfgPlaceGroup1.EndChange()
  #raw_input("Capacity rule %s assigned to place group %s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleA.name, CfgPlaceGroup1.groupInfo.name))

  #CfgAgentGroup1.BeginChange()
  #CfgAgentGroup1.groupInfo.capacityRuleDBID = CfgScriptCapRuleA.DBID
  #CfgAgentGroup1.EndChange()
  #raw_input("Capacity rule %s assigned to agent group %s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleA.name, CfgAgentGroup1.groupInfo.name))

  CfgTenantAuto.BeginChange()
  CfgTenantAuto.defaultCapacityRuleDBID = CfgScriptCapRuleA.DBID
  CfgTenantAuto.EndChange()
  raw_input("Capacity rule %s assigned to tenant %s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleA.name, CfgTenantAuto.name))

  #---------edit capacity rule---------------
  CfgScriptCapRuleA.BeginChange()
  CfgScriptCapRuleA.name = "CapacityRule_A2"
  CfgScriptCapRuleA.userProperties = CfgScriptCapRuleA2_M.userProperties
  CfgScriptCapRuleA.EndChange()
  raw_input("Capacity rule changed. Name = %s, tenant = %s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleA.name, CfgTenantAuto.name))


  #---------add new capacity rule---------------
  CfgScriptCapRuleB = CfgScript()
  CfgScriptCapRuleB.SetAttributes({"name":           "CapacityRule_B",
                                 "tenantDBID":     CfgTenantAuto.DBID,
                                 "type":           CfgScriptType.CFGCapacityRule.val,
                                 "userProperties": CfgScriptCapRuleB_M.userProperties
                                  })
  CfgScriptCapRuleB.Add()  
  raw_input("Capacity rule added. Name = %s, tenant =%s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleA.name, CfgTenantAuto.name))


  #---------assign cap rule B to agent, agent group, place group, tenant---------------
  CfgPersonAgent1.BeginChange()
  CfgPersonAgent1.agentInfo.capacityRuleDBID = CfgScriptCapRuleB.DBID
  CfgPersonAgent1.EndChange()
  raw_input("Capacity rule %s assigned to agent %s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleB.name, CfgPersonAgent1.userName))

  CfgPlace1.BeginChange()
  CfgPlace1.capacityRuleDBID = CfgScriptCapRuleB.DBID
  CfgPlace1.EndChange()
  raw_input("Capacity rule %s assigned to place %s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleB.name, CfgPlace1.name))

  #CfgPlaceGroup1.BeginChange()
  #CfgPlaceGroup1.groupInfo.capacityRuleDBID = CfgScriptCapRuleB.DBID
  #CfgPlaceGroup1.EndChange()
  #raw_input("Capacity rule %s assigned to place group %s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleB.name, CfgPlaceGroup1.groupInfo.name))

  #CfgAgentGroup1.BeginChange()
  #CfgAgentGroup1.groupInfo.capacityRuleDBID = CfgScriptCapRuleB.DBID
  #CfgAgentGroup1.EndChange()
  #raw_input("Capacity rule %s assigned to agent group %s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleB.name, CfgAgentGroup1.groupInfo.name))


  CfgTenantAuto.BeginChange()
  CfgTenantAuto.defaultCapacityRuleDBID = CfgScriptCapRuleB.DBID
  CfgTenantAuto.EndChange()
  raw_input("Capacity rule %s assigned to tenant %s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleB.name, CfgTenantAuto.name))


  #---------assign cap rule A to agent, agent group, place group (not TENANT)---------------
  CfgPersonAgent1.BeginChange()
  CfgPersonAgent1.agentInfo.capacityRuleDBID = CfgScriptCapRuleA.DBID
  CfgPersonAgent1.EndChange()
  raw_input("Capacity rule %s assigned to agent %s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleA.name, CfgPersonAgent1.userName))

  CfgPlace1.BeginChange()
  CfgPlace1.capacityRuleDBID = CfgScriptCapRuleA.DBID
  CfgPlace1.EndChange()
  raw_input("Capacity rule %s assigned to place %s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleA.name, CfgPlace1.name))

  #CfgPlaceGroup1.BeginChange()
  #CfgPlaceGroup1.groupInfo.capacityRuleDBID = CfgScriptCapRuleA.DBID
  #CfgPlaceGroup1.EndChange()
  #raw_input("Capacity rule %s assigned to place group %s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleA.name, CfgPlaceGroup1.groupInfo.name))

  #CfgAgentGroup1.BeginChange()
  #CfgAgentGroup1.groupInfo.capacityRuleDBID = CfgScriptCapRuleA.DBID
  #CfgAgentGroup1.EndChange()
  #raw_input("Capacity rule %s assigned to agent group %s. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleA.name, CfgAgentGroup1.groupInfo.name))


  CfgScriptCapRuleA.Delete()

  CfgScriptCapRuleB.Delete()

  raw_input("Capacity rules %s, %s deleted. \nCheck SS reaction, expected results is log printout. Press Enter." %(CfgScriptCapRuleA.name, CfgScriptCapRuleB.name))
  